package com.icity.mapper;

import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import com.icity.entity.Retentions;
/**
 *
 * @author apple
 */
@Mapper
public interface RementionStatisticalMapper {

	@Select("<script>"
			+"select count(id) from tbl_statistics_retentions where 1 = 1"
			+ "<if test='startDate != null'>"
			+" and date between #{startDate} and #{endDate}"
			+ "</if>"
			+ " </script>")
	int selectRetentionCount(Map<Object, Object> map);//列表个数

	@Select("<script>"
			+"select * "
			+ "from tbl_statistics_retentions where 1 = 1"
			+ "<if test='startDate != null'>"
			+" and date between #{startDate} and #{endDate} "
			+ "</if>"
			+ " ORDER BY date desc"
			+ " limit #{page},#{limit} "
			+ " </script>")
	List<Retentions> selectRetention(Map<Object, Object> map);//查询文章统计列表

}
